﻿using Pb;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PDKUser : MonoBehaviour
{

    EginPDK ddz = EginPDK.Instance;
    EginUser user = EginUser.Instance;
    public UISprite avatar;
    public UILabel coinLabel;
    public GameObject markObj;
    public UISprite ReadyStatus;
    public GameObject AutoStatus;
    public GameObject clock;
    public int seatId;
    public SEX sex;
    public UILabel text;
    public UISprite face;
    public GameObject textObj;
    public GameObject WinSpriteObj;
    public GameObject BaoDan;
    public UILabel timeLabel;
    public UITexture wxAvatar;
    void Awake()
    {
        UIEventListener.Get(avatar.gameObject).onClick = ButtonClick;
    }

    void ButtonClick(GameObject button)
    {
        if (button.name == "Avatar")
        {
            GameObject userInfo = NGUITools.AddChild(GameObject.Find("UI Root"), (GameObject)Resources.Load(GamePDKPrefabPath.UserInfoPanel));
            userInfo.GetComponent<PDKUserInfo>().LoadUserInfo(seatId);
        }       
    }

    public void InitPlayer()
    {
        gameObject.SetActive(false);
        WinSpriteObj.SetActive(false);
        ReadyStatus.gameObject.SetActive(false);
        text.gameObject.SetActive(false);
        face.gameObject.SetActive(false);
        textObj.SetActive(false);

    }

    
}